import request from '@/utils/request'

// 获取字典类型分页列表
export function getDictTypePageList(data,page,size) {
    return request({
        url: `/system/sysDictTypeController/getDictTypePageList?page=${page}&size=${size}`,
        method: 'post',
        data: data
    })
}

// 获取字典类型详情
export function getDictTypeDetail(id) {
    return request({
        url: `/system/sysDictTypeController/getDictTypeDetail?id=${id}`,
        method: 'get'
    })
}

// 新增字典类型
export function addDictType(data) {
    return request({
        url: '/system/sysDictTypeController/addDictType',
        method: 'post',
        data: data
    })
}

// 编辑字典类型
export function updateDictType(data) {
    return request({
        url: '/system/sysDictTypeController/updateDictType',
        method: 'put',
        data: data
    })
}

// 删除字典类型
export function deleteDictType(id) {
    return request({
        url: `/system/sysDictTypeController/deleteDictType?id=${id}`,
        method: 'delete'
    })
}

// 获取字典选项
export function getDictOptionList(dictKey) {
    return request({
        url: `/system/sysDictTypeController/getDictOptionList?dictKey=${dictKey}`,
        method: 'get'
    })
}
